/**
 * vue插件：注册全局组件
 */
import Skeleton from './Skeleton'
import Slider from './Slider'
import More from './More'
import Bread from './Bread'
import BreadItem from './Bread/item.vue'
import City from './City'
import Sku from './Sku'
import Numbox from './Numbox'
import Button from './Button'
import CheckBox from './CheckBox'

// 1. 准备放置组件数据
const cps = [CheckBox, Skeleton, Slider, More, Bread, BreadItem, City, Sku, Numbox, Button]

export default {
  /**
   * vue2：Vue构造函数 作用：注册全局组件、指令、过滤器、方法、混入
   * vue3：app 根实例 作用：注册全局组件、指令、混入
   * @param {*} app
   */
  install (app) {
    // console.log('根实例:', app)
    // app.component('Skeleton', Skeleton)
    cps.forEach(cp => {
      app.component(cp.name, cp)
    })
  }
}
